package com.mallsystem.orderservice.mapper;

import com.mallsystem.common.bean.Cart;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CartMapper {
    //添加
    int insert(Cart cart);
    //根据id删除
    int delete(Integer id);
    //批量删除
    int deleteBatch(List<Integer> ids);
    //修改
    int update(Cart cart);
    //根据用户id和商品id查询
    Cart selectByUserIdAndGoodsId(@Param("userid") Integer userid, @Param("goodsId") Integer goodsId);
    //根据id查询
    Cart selectById(Integer id);
    //根据条件查询
    List<Cart> selectByCondition(Cart condition);
    List<Cart> selectByIds(@Param("cartIds") Integer[] cartIds);
}
